package com.example.xyxwebbackend001.security;


import cn.dev33.satoken.stp.StpInterface;
import com.example.xyxwebbackend001.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;

@Component
public class StpInterfaceImpl implements StpInterface {
    @Autowired
    private UserService userService;

    @Override
    public List<String> getRoleList(Object loginId, String loginType) {
        Integer userId = Integer.parseInt(loginId.toString());
        return userService.getRolesByUserId(userId);
    }

    @Override
    public List<String> getPermissionList(Object loginId, String loginType) {
        return null;
    }
}
